package com.api.regression.group.preview;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IGroupApiService;
import com.zyncro.api.exceptions.ZyncroApiException;

@ContextConfiguration(locations = { "classpath:/group/group-upload.xml" })
public class PreviewNotParticipant extends AbstractApiTest {

	private static final int DEFAULT_WITH = 50;
	private static final int DEFAULT_HEIGHT = 50;

	@Value("#{group_toPreview[notParticipant].appId}")
	private String userUrn;

	@Value("#{group_toPreview[notParticipant].password}")
	private String userPassword;

	@Value("#{group_toPreview.urn}")
	private String groupUrn;

	@Value("#{group_toPreview.imageJpgUrn}")
	private String imageJpgUrn;

	@BeforeClass
	protected void loginUser() throws Exception {

		getApi().login(userUrn, userPassword);
	}

	@Test
	public void testPreviewJpg() throws ZyncroApiException {

		int mode = 0;

		getApi().getService(IGroupApiService.class).preview(groupUrn, imageJpgUrn, getApi().getAccessKey(), DEFAULT_WITH, DEFAULT_HEIGHT,
				mode);
	}
}
